Use the doc-values skip index to skip per-doc value lookups in LongRangeFacetCutter#16268
Open
slow-J wants to merge 5 commits into
Open
Use the doc-values skip index to skip per-doc value lookups in LongRangeFacetCutter#16268slow-J wants to merge 5 commits into
slow-J wants to merge 5 commits into
Conversation
03d7d2a to
066c419
Compare
Contributor
Author
|
I reran benchmarks, this time correctly using localrun, and updated the results in #16268 (comment) |
2e7144b to
0c72d5f
Compare
epotyom
reviewed
Jun 19, 2026
epotyom
left a comment
Contributor
There was a problem hiding this comment.
Nice change! One suggestion below
epotyom
reviewed
Jun 19, 2026
1065433 to
7db2833
Compare
7db2833 to
88fe293
Compare
epotyom
reviewed
Jun 30, 2026
| } | ||
|
|
||
| /** Single-valued {@link LongValues} for {@link #skipField} in this segment. */ | ||
| final LongValues skipFieldValues(LeafReaderContext context) throws IOException { |
Contributor
There was a problem hiding this comment.
Is this method a part of the single value unwrapping logic that we want to remove for now?
Contributor
Author
There was a problem hiding this comment.
Nope, this is part of the core skipper path.
…range-facets # Conflicts: # lucene/CHANGES.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #16249
Implementation heavily inspired by HistogramCollector.java.
Range faceting (in the sandbox module -
LongRangeFacetCutter) currently reads the doc-values value for every matching document and binary-searches it into an elementary interval. When the faceted field is single-valued, we can use a doc-values skip index. For a dense skip block whose min and max values fall into the same elementary interval, every document in that block maps to that interval, allowing us to skip the per-doc value lookup and binary search.Limitation - applies to single-valued, long fields only.
Benchmark (luceneutil)
I used my branch of https://github.com/slow-J/luceneutil/tree/github-16249-range-facet-bench which cherry picked 2 of @epotyom 's commits (mainly mikemccand/luceneutil#582 which adds range-facet support)
Setup:
runlocal.py,wikimediumall(33.3M docs), index-sorted bylastMod_skipperwithaddDVSkippers=true. baseline = main, candidate = this change, both DURING_COLLECTION, sothe only difference is this optimization. 30 JVM iterations.
Command:
python3 -u src/python/localrun.py -s rangeFacetsWikimediumAll -b lucene_baseline -c lucene_candidate -iterations 30 -warmups 20 2>&1 | tee "$BASE/run-timing7.txt"Edit: new benchmark results after the changes for Egors first 2 comments.
Edit2: new benchmark results after unwrapping removed
QPS
Latency (ms) — aggregated across all iterations